<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>登录</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"/>
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta name="format-detection" content="telephone=no" />
	<link rel="stylesheet" href="../css/public-heder-Reset.css">
	<link rel="stylesheet" href="../css/input-button.css">
</head>
<body>
	<!-- page_box -->
	<div class="page-box">
		<!-- header -->
		<header class="page-header">
			<a href="index.html" class="home">主页</a>
			<p class="pege-name">登录</p>
			<a href="Ucenter/register.html" class="Refresh">注册</a>
		</header>
		<div class="liubai"></div>
		<!-- header /-->
		<!-- User-information -->
		<div class="User-information">
			<div class="User-form">
				<div class="user-name">
					<label>
						<input type="text"  style="font-size:17px"  placeholder="请输入用户名或手机号码" >
						<span class=""></span>
					</label>
				</div>
				<div class="password">
					<label>
						<input type="password" class="eliminate" style="font-size:17px" placeholder="请输入登录密码">
						<span class=""></span>
					</label>
				</div> 
			</div>
			<div class="User_agreement">
				<label>
					<div class="checkboxFour fl">
					  	<input type="checkbox" checked="checked" value="1" id="checkboxFourInput" name="" />
					    <label for="checkboxFourInput"></label>
		  			</div>
		  			<p class="fl">记住密码</p>
				</label>
			</div>
			<div class="submit-btn">
				<button style="border:none" disabled="disabled" type="submit">登录</button>
			</div>	
			<div class="plcs">
				<a href="Ucenter/Retrieve-password.html">忘记密码?</a>
			</div>
		</div>
		<!-- User-information / -->
	</div>
	<script type="text/javascript" src="../js/jquery.min.js"></script>
	<script type="text/javascript" src="../js/http-url.js"></script>
	<script type="text/javascript" src="../js/md5.js"></script>
	<script type="text/javascript">
	$(function(){
		if (top.location != location)  
			{  
				top.location.href = location.href;  
			} 
		$("input").on("keyup", function (event) {
			var phone_number=$('.user-name input').val().trim();
			var password=$('.password input').val();
			//输入信息符合规则 开启提交按钮
		    if(phone_number.length>=6 && password.length>=6){
			   	sureSubmit()
		    }else {
	   			cannotSubmit()
		    }
		 });
		$('.submit-btn').find('button').click(function(){
			submitOk()
			var phone_number=$('.user-name input').val().trim();
			var password=hex_md5($('.password input').val());
			var userdata={'phone_number':phone_number,'password':password}
			ajaxRequest('/api/login/',userdata,function(data){
				if (data.m_status==200) {
					if(document.getElementById('checkboxFourInput').checked){
					 	window.localStorage.setItem("phone_number",phone_number);
					    window.localStorage.setItem("password",password);
					}
					window.location.href="index.html";
				}
			},false);
		});
	});
	</script>
</body>
</html>